package com.auth.manage.datasource.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)  // 主键
    private Long id;

    @TableLogic  // 逻辑删除
    @TableField(fill = FieldFill.INSERT)  // TableField：非主键字段和数据库字段的映射
    private Integer deleted;

    @Version  // 乐观锁
    @TableField(fill = FieldFill.INSERT)  // 插入的逻辑需要自己实现
    private Integer lockVersion;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    private Date updateTime;
}